package com.yanqu.road.entity.drugstore;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

@FieldTypeAnnotation(tableName = "t_u_drug_order", desc = "处方订单")
public class UserDrugChuFangOrderData extends DataObject {

    @FieldTypeAnnotation(update = true, select = true, desc = "玩家")
    private long userId;

    @FieldTypeAnnotation(update = true, desc = "订单号")
    private long no;

    @FieldTypeAnnotation(desc = "npc小人")
    private long npc;

    @FieldTypeAnnotation(desc = "问诊工作站")
    private int table;

    @FieldTypeAnnotation(desc = "处方")
    private int chuFang;

    @FieldTypeAnnotation(desc = "对话id")
    private int dialogId;

    @FieldTypeAnnotation(desc = "处方等级")
    private int chuFangLv;

    @FieldTypeAnnotation(desc = "药材需求进度")
    List<DrugOrderNeed> process = new ArrayList<>();

    @FieldTypeAnnotation(desc = "状态, 0:未完成；1：已完成；2：已领奖")
    private int state;

    @FieldTypeAnnotation(desc = "奖励")
    private String reward = "";

    @FieldTypeAnnotation(desc = "奖励领取情况")
    private boolean getReward;

    @FieldTypeAnnotation(desc = "订单生成时间")
    private long orderTime;

    @FieldTypeAnnotation(desc = "抓药开始时间")
    private long drugPlantStartTime;

    @FieldTypeAnnotation(desc = "抓药结束时间")
    private long drugPlantDoneTime;

    @FieldTypeAnnotation(desc = "制药完成时间")
    private long drugMakeEndTime;

    @FieldTypeAnnotation(desc = "领奖时间")
    private long getRewardTime;

    @FieldTypeAnnotation(desc = "订单完成时间")
    private long finishTime;

    @FieldTypeAnnotation(desc = "接待时间")
    private long receiveTime;

    //缓存，是否需要同步给客户端
    private boolean needSync;

    public long getNo() {
        return no;
    }

    public void setNo(long no) {
        if(this.no != no) {
            this.no = no;
            setUpdateOption();
        }
    }

    public long getNpc() {
        return npc;
    }

    public void setNpc(long npc) {
        if(this.npc != npc) {
            this.npc = npc;
            setUpdateOption();
        }
    }

    public int getTable() {
        return table;
    }

    public void setTable(int table) {
        if(this.table != table) {
            this.table = table;
            setUpdateOption();
        }
    }

    public int getChuFang() {
        return chuFang;
    }

    public void setChuFang(int chuFang) {
        if(this.chuFang != chuFang) {
            this.chuFang = chuFang;
            setUpdateOption();
        }
    }

    public int getDialogId() {
        return dialogId;
    }

    public void setDialogId(int dialogId) {
        if(this.dialogId != dialogId) {
            this.dialogId = dialogId;
            setUpdateOption();
        }
    }

    public int getChuFangLv() {
        return chuFangLv;
    }

    public void setChuFangLv(int chuFangLv) {
        if(this.chuFangLv != chuFangLv) {
            this.chuFangLv = chuFangLv;
            setUpdateOption();
        }
    }

    public List<DrugOrderNeed> getProcess() {
        return process;
    }

    public void setProcess(List<DrugOrderNeed> process) {
        this.process = process;
        setUpdateOption();
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        if(this.state != state) {
            this.state = state;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public String getReward() {
        return reward;
    }

    public void setReward(String reward) {
        if(!Objects.equals(this.reward, reward)) {
            this.reward = reward;
            setUpdateOption();
        }
    }

    public boolean isGetReward() {
        return getReward;
    }

    public void setGetReward(boolean getReward) {
        if(this.getReward != getReward) {
            this.getReward = getReward;
            setUpdateOption();
        }
    }

    public long getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(long orderTime) {
        if(this.orderTime != orderTime) {
            this.orderTime = orderTime;
            setUpdateOption();
        }
    }

    public long getDrugPlantStartTime() {
        return drugPlantStartTime;
    }

    public void setDrugPlantStartTime(long drugPlantStartTime) {
        if(this.drugPlantStartTime != drugPlantStartTime) {
            this.drugPlantStartTime = drugPlantStartTime;
            setUpdateOption();
        }
    }

    public long getDrugPlantDoneTime() {
        return drugPlantDoneTime;
    }

    public void setDrugPlantDoneTime(long drugPlantDoneTime) {
        if(this.drugPlantDoneTime != drugPlantDoneTime) {
            this.drugPlantDoneTime = drugPlantDoneTime;
            setUpdateOption();
        }
    }

    public long getDrugMakeEndTime() {
        return drugMakeEndTime;
    }

    public void setDrugMakeEndTime(long drugMakeEndTime) {
        if(this.drugMakeEndTime != drugMakeEndTime) {
            this.drugMakeEndTime = drugMakeEndTime;
            setUpdateOption();
        }
    }

    public long getGetRewardTime() {
        return getRewardTime;
    }

    public void setGetRewardTime(long getRewardTime) {
        if(this.getRewardTime != getRewardTime) {
            this.getRewardTime = getRewardTime;
            setUpdateOption();
        }
    }

    public long getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(long finishTime) {
        if(this.finishTime != finishTime) {
            this.finishTime = finishTime;
            setUpdateOption();
        }
    }

    public long getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(long receiveTime) {
        if(this.receiveTime != receiveTime) {
            this.receiveTime = receiveTime;
            setUpdateOption();
        }
    }

    public boolean isNeedSync() {
        return needSync;
    }

    public void setNeedSync(boolean needSync) {
        this.needSync = needSync;
    }
}
